package code;

import java.util.ArrayList;
import java.util.List;

public abstract class Scheduler extends Action {

	protected List<Action> actions;

	public Scheduler() {
		this.actions = new ArrayList<Action>();
	}

	public Scheduler(List<Action> actions) {
		this.actions = actions;
	}

	public boolean isFinished() {
		for (Action a : actions) {
			if (!a.isFinished())
				return false;
		}
		return true;
	}

	@Override
	public boolean isReady() {
		for (Action a : actions) {
			if (!a.isReady())
				return false;
		}
		return true;
	}

	public boolean add(Action a) {
		return this.actions.add(a);
	}

	@Override
	protected abstract void realDoStep();
}
